package com.qyer.search.model;

import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

/**
 * User: Z J Wu Date: 2016/01/04 Time: 18:37 Package: com.qyer.search.model
 */
public final class Tuple<T> {

  private List<T> entities;

  public Tuple(T... entities) {
    this.entities = Arrays.asList(entities);
  }

  public Tuple(Collection<T> entities) {
    this.entities = new ArrayList<>(entities);
  }

  public List<T> getEntities() {
    return entities;
  }

  @Override public String toString() {
    return new ToStringBuilder(this).append("entities", entities).toString();
  }
}
